package com.ray.controller;

import com.ray.mapper.UserInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author wangfl
 * @date 2022/9/20 10:46
 */
@Slf4j
@RestController
@RequestMapping("test")
public class UserController {
    @Autowired
    private UserInfoMapper userInfoMapper;

    @RequestMapping("/list")
    public List getUserList(){
        log.info("test field is null");
        ArrayList<HashMap<String, Object>> userList = (ArrayList)userInfoMapper.getUserList();
        log.info(userList.toString());
        return userList;
    }
    @RequestMapping("/query")
    public Map getUserInfo(){
        log.info("test field is null");
        HashMap<String, Object> userInfo = userInfoMapper.getUserInfo();
        //log.info(userInfo);
        return userInfo;
    }
}
